var express = require('express');
var router = express.Router();
var fs = require('fs');

/* GET users listing. */


router.get('/:filename', function(req, res, next) {

  var path = "./restapp/data/" +req.params.filename;
  
  fs.readFile(path,'utf-8',function(err,data){
  	console.log(err)
  	if(err){
  		console.log("error");
  	}else{
  		 res.send(data);
  	}
  });


 

  // res.end();
});

module.exports = router;

